<?php $this->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf8'); echo $this->headMeta();?>
<?php 
	$customerDb = new Application_Model_DbTable_Customer();
	$auth = Zend_Auth::getInstance();
	$email = $auth->getIdentity();
	$customer = $customerDb->findByEmail($email);
	$yourCart = new Zend_Session_Namespace('cart');
	$sumCart = 0;
	if ($yourCart->cart) {
		foreach($yourCart->cart as $key => $val) {
			$sumCart += (int) $val;
		}
	}
?>
<!-- Bootstrap core CSS -->
<!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<link href="<?=WEB_PATH?>/public/imgs/favicon.png" rel="shortcut icon">
<link href="<?=WEB_PATH?>/public/css/bootstrap.css" rel="stylesheet">
<link href="<?=WEB_PATH?>/public/css/style.css" rel="stylesheet">

<!-- Bootstrap core JavaScript
 ================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="<?=WEB_PATH?>/public/js/jquery-1.10.2.js"></script>
<script src="<?=WEB_PATH?>/public/js/bootstrap.js"></script>
<script src="<?=WEB_PATH?>/public/js/bootstrap-slider.js"></script>

<div class="navbar navbar-fixed-top navbar-inverse" >
	<div class="container">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
				data-target=".navbar-collapse">
				<span class="icon-bar"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="<?=WEB_PATH?>">PhoneSale</a>
		</div>
		<div class="collapse navbar-collapse">
			<ul class="nav navbar-nav">
				<li class=""><a href="#about">Thông tin</a></li>
				<li><a href="<?=WEB_PATH?>/index/feedback">Liên Hệ</a></li>
			</ul>
			<form class="navbar-form navbar-left" role="search" action="<?=WEB_PATH?>/Search/search" method="post">
				<div class="form-group">
					<input id="search-text" name="search-text" type="text" class="form-control"
						placeholder="tag, phone's name, brand">
				</div>
				<button type="submit" class="btn btn-default">Tìm Kiếm</button>
			</form>
			<ul class="nav navbar-nav navbar-right">
				<?php if (!$customer) {?>
					<li><a href="<?=WEB_PATH?>/customer/register">Đăng ký</a></li>
					<li><a href="<?=WEB_PATH?>/customer/login">Đăng nhập</a></li>
				<?php }else {?>
					<li>
						<div class="btn-group navbar-form">
						  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
						    Welcome <?=$customer->name?><span class="caret"></span>
						  </button>
						  <ul class="dropdown-menu" role="menu">
						    <li><a href="<?=WEB_PATH?>/customer/manage">Quản Lý</a></li>
						    <li class="divider"></li>
						    <li><a href="<?=WEB_PATH?>/customer/logout">Đăng xuất</a></li>
						  </ul>
						</div>
					</li>
				<?php }?>
				
				<li class="active">
				<a href="<?=WEB_PATH?>/customer/showcart" class="nav-pills"> 
					<span class="glyphicon glyphicon-shopping-cart"></span> 
					<span class="badge pull-right"><?=$sumCart?></span> Giỏ hàng
				</a>
				</li>
			</ul>
		</div>
		<!-- /.nav-collapse -->
	</div>
	<!-- /.container -->
</div>
<!-- /.navbar -->
<?php echo $this->layout()->content; ?>

<script type="text/javascript">
<!--
	var min_options = {min : 1000000, 
					   max: 10000000, 
					   step: 1000000, 
					   orientation: 'horizontal', 
					   value : 5000000,
					   tooltip : 'show'};
	var max_options = {min: 10000000, 
					   max: 30000000, 
					   step: 1000000, 
					   orientation: 'horizontal', 
					   value : 15000000,
					   tooltip : 'show'};
	$("#min-price").slider(min_options)
		.on('slide', function(ev) {
				$("#min-price").value = $("#min-price").slider('getValue');
			});
	
	$("#max-price").slider(max_options)
		.on('slide', function(ev) {
				$("#max-price").value = $("#max-price").slider('getValue');
			});
//-->
</script>




